﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/management.Master" AutoEventWireup="true" CodeBehind="person.aspx.cs" Inherits="pcsse.management.WebForm1"  %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="hoder_sidebar" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="hoder_maincontent" runat="server">
<div class="p_title">
人员管理
</div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
            <asp:DetailsView ID="filterDv" runat="server" AutoGenerateRows="False" 
                DataKeyNames="ID" DataSourceID="pGvOds" DefaultMode="Insert" Height="50px" 
                Width="300px">
                <Fields>
                    <asp:TemplateField HeaderText="编号" SortExpression="NUMBER">
                        <EditItemTemplate>
                            <asp:TextBox ID="numberTb" runat="server" Height="20px" 
                                Text='<%# Bind("NUMBER") %>' Width="100px"></asp:TextBox>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="numberTb" runat="server" Height="20px" 
                                Text='<%# Bind("NUMBER") %>' Width="100px"></asp:TextBox>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("NUMBER") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="姓名" SortExpression="NAME">
                        <EditItemTemplate>
                            <asp:TextBox ID="nameTb" runat="server" Height="20px" 
                                Text='<%# Bind("NAME") %>' Width="100px"></asp:TextBox>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="nameTb" runat="server" Height="20px" 
                                Text='<%# Bind("NAME") %>' Width="100px"></asp:TextBox>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("NAME") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="支部" SortExpression="FULLNAME">
                        <EditItemTemplate>
                            <asp:DropDownList ID="bfilterDdl" runat="server" DataSourceID="branchOds" 
                                DataTextField="FULLNAME" DataValueField="ID" Height="20px" Width="150px">
                                <asp:ListItem>全部</asp:ListItem>
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:DropDownList ID="bfilterDdl" runat="server" AppendDataBoundItems="True" 
                                DataSourceID="branchOds" DataTextField="FULLNAME" DataValueField="FULLNAME" 
                                Height="20px" Width="150px">
                                <asp:ListItem>全部</asp:ListItem>
                            </asp:DropDownList>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("FULLNAME") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="状态" SortExpression="STATE_TEXT">
                        <EditItemTemplate>
                            <asp:DropDownList ID="sfilterDdl" runat="server" DataSourceID="stateOds" 
                                DataTextField="STATE_TEXT" DataValueField="STATE_ID" Height="20px" 
                                Width="100px">
                                <asp:ListItem Selected="True">全部</asp:ListItem>
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:DropDownList ID="sfilterDdl" runat="server" AppendDataBoundItems="True" 
                                DataSourceID="stateOds" DataTextField="STATE_TEXT" DataValueField="STATE_TEXT" 
                                Height="20px" Width="100px">
                                <asp:ListItem Selected="True">全部</asp:ListItem>
                            </asp:DropDownList>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("STATE_TEXT") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False">
                        <EditItemTemplate>
                            <asp:LinkButton ID="newBt" runat="server" onclick="newBt_Click">添加数据</asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="filterBt" runat="server" CausesValidation="false" 
                                CommandName="" onclick="filterBt_Click" Text="查找"></asp:LinkButton>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:LinkButton ID="newBt" runat="server" onclick="newBt_Click">添加数据</asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="filterBt" runat="server" CausesValidation="false" 
                                CommandName="" onclick="filterBt_Click" Text="查找"></asp:LinkButton>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            &nbsp;
                        </ItemTemplate>
                    </asp:TemplateField>
                </Fields>
                <FieldHeaderStyle Width="60px" />
            </asp:DetailsView>
            <asp:GridView ID="pGv" runat="server" AutoGenerateColumns="False" 
                DataKeyNames="ID" DataSourceID="pGvOds" AllowPaging="true">
                <Columns>
                    <asp:CommandField SelectText="查看/编辑" ShowSelectButton="True" />
                    <asp:BoundField DataField="NUMBER" HeaderText="编号" SortExpression="NUMBER">
                        <HeaderStyle Width="100px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="NAME" HeaderText="姓名" SortExpression="NAME">
                        <HeaderStyle Width="100px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="FULLNAME" HeaderText="支部名称" ReadOnly="True" 
                        SortExpression="FULLNAME">
                        <HeaderStyle Width="150px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="PRI_TEXT" HeaderText="权限" SortExpression="PRI_TEXT">
                        <HeaderStyle Width="120px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="STATE_TEXT" HeaderText="状态" 
                        SortExpression="STATE_TEXT">
                        <HeaderStyle Width="100px" />
                    </asp:BoundField>
                </Columns>
            </asp:GridView>
            <asp:ObjectDataSource ID="pGvOds" runat="server" 
                OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataByPriority" 
                TypeName="personTableAdapters.T_PERSONINFOTableAdapter">
                <SelectParameters>
                    <asp:SessionParameter DefaultValue="1" Name="PRIORITY_ID" 
                        SessionField="Priority" Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <asp:DetailsView ID="pinfoDv" runat="server" AutoGenerateRows="False" 
                DataKeyNames="ID" DataSourceID="pinfoGvOds" Height="50px" 
                oniteminserted="pinfoDv_ItemInserted" onitemupdated="pinfoDv_ItemUpdated" 
                Width="500px">
                <FieldHeaderStyle Width="120px" />
                <Fields>
                    <asp:BoundField DataField="NUMBER" HeaderText="编号" SortExpression="NUMBER" />
                    <asp:BoundField DataField="NAME" HeaderText="姓名" SortExpression="NAME" />
                    <asp:TemplateField HeaderText="性别" SortExpression="GENDER">
                        <EditItemTemplate>
                            <asp:DropDownList ID="genderDdl" runat="server" Height="20px" 
                                SelectedValue='<%# Bind("GENDER") %>' Width="60px">
                                <asp:ListItem>男</asp:ListItem>
                                <asp:ListItem>女</asp:ListItem>
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:DropDownList ID="genderDdl" runat="server" Height="20px" 
                                SelectedValue='<%# Bind("GENDER") %>' Width="60px">
                                <asp:ListItem>男</asp:ListItem>
                                <asp:ListItem>女</asp:ListItem>
                            </asp:DropDownList>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("GENDER") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="NATIONALITY" HeaderText="民族" 
                        SortExpression="NATIONALITY" />
                    <asp:TemplateField HeaderText="出生日期" SortExpression="BIRTHDAY">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" onfocus="calendar()" 
                                Text='<%# Bind("BIRTHDAY", "{0:d}") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" onfocus="calendar()" 
                                Text='<%# Bind("BIRTHDAY", "{0:d}") %>'></asp:TextBox>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" 
                                Text='<%# Bind("BIRTHDAY", "{0:d}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="证件编号" SortExpression="IDNUMBER">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Height="20px" 
                                Text='<%# Bind("IDNUMBER") %>' Width="200px"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                                ControlToValidate="TextBox2" ErrorMessage="请输入正确的身份证号码" 
                                ValidationExpression="\d{17}[\d|X]|\d{15}"></asp:RegularExpressionValidator>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Height="20px" 
                                Text='<%# Bind("IDNUMBER") %>' Width="200px"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                                ControlToValidate="TextBox2" ErrorMessage="请输入正确的身份证号码" 
                                ValidationExpression="\d{17}[\d|X]|\d{15}"></asp:RegularExpressionValidator>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("IDNUMBER") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="联系电话" SortExpression="TELEPNONE">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox11" runat="server" Height="20px" 
                                Text='<%# Bind("TELEPNONE") %>' Width="150px"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                ControlToValidate="TextBox1" ErrorMessage="联系方式不正确" 
                                ValidationExpression="(\d{11})|(\(\d{3}\)|\d{3}-)?\d{8}"></asp:RegularExpressionValidator>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox11" runat="server" Height="20px" 
                                Text='<%# Bind("TELEPNONE") %>' Width="150px"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                ControlToValidate="TextBox1" ErrorMessage="联系方式不正确" 
                                ValidationExpression="(\d{11})|(\(\d{3}\)|\d{3}-)?\d{8}"></asp:RegularExpressionValidator>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("TELEPNONE") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="电子邮件" SortExpression="EMAIL">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox4" runat="server" Height="20px" 
                                Text='<%# Bind("EMAIL") %>' Width="200px"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
                                ControlToValidate="TextBox4" ErrorMessage="电子邮件格式不正确" 
                                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox4" runat="server" Height="20px" 
                                Text='<%# Bind("EMAIL") %>' Width="200px"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
                                ControlToValidate="TextBox4" ErrorMessage="电子邮件格式不正确" 
                                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("EMAIL") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="权限" SortExpression="PRI_TEXT">
                        <EditItemTemplate>
                            <asp:DropDownList ID="priorityDdl" runat="server" DataSourceID="priorityOds" 
                                DataTextField="PRI_TEXT" DataValueField="ID" Height="20px" 
                                SelectedValue='<%# Bind("PRIORITY_ID") %>' Width="100px">
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:DropDownList ID="priorityDdl" runat="server" DataSourceID="priorityOds" 
                                DataTextField="PRI_TEXT" DataValueField="ID" Height="20px" 
                                SelectedValue='<%# Bind("PRIORITY_ID") %>' Width="100px">
                            </asp:DropDownList>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("PRI_TEXT") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False">
                        <EditItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                                CommandName="Update" Text="更新"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                                CommandName="Cancel" Text="取消"></asp:LinkButton>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                                CommandName="Insert" Text="插入"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                                CommandName="Cancel" Text="取消"></asp:LinkButton>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                CommandName="Edit" Text="编辑"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                                CommandName="New" Text="新建"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" 
                                CommandName="Delete" Text="删除"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="PartyBt" runat="server" onclick="PartyBt_Click">党员信息</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Fields>
                <HeaderStyle Width="120px" />
            </asp:DetailsView>
            <asp:ObjectDataSource ID="priorityOds" runat="server" InsertMethod="Insert" 
                OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataByID" 
                TypeName="managementTableAdapters.T_PRIORITYTableAdapter">
                <SelectParameters>
                    <asp:SessionParameter DefaultValue="1" Name="Original_ID" 
                        SessionField="Priority" Type="Int32" />
                </SelectParameters>
                <InsertParameters>
                    <asp:Parameter Name="PRI_TEXT" Type="String" />
                </InsertParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="pinfoGvOds" runat="server" DeleteMethod="DeleteQuery" 
                InsertMethod="InsertQuery" OldValuesParameterFormatString="original_{0}" 
                SelectMethod="GetDataByID" 
                TypeName="managementTableAdapters.T_PERSONINFOTableAdapter" 
                UpdateMethod="UpdateQuery">
                <DeleteParameters>
                    <asp:Parameter Name="Original_ID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="NUMBER" Type="String" />
                    <asp:Parameter Name="NAME" Type="String" />
                    <asp:Parameter Name="GENDER" Type="String" />
                    <asp:Parameter Name="NATIONALITY" Type="String" />
                    <asp:Parameter Name="BIRTHDAY" Type="DateTime" />
                    <asp:Parameter Name="IDNUMBER" Type="String" />
                    <asp:Parameter Name="TELEPNONE" Type="String" />
                    <asp:Parameter Name="EMAIL" Type="String" />
                    <asp:Parameter Name="PRIORITY_ID" Type="Int32" />
                    <asp:Parameter Name="Original_ID" Type="Int32" />
                </UpdateParameters>
                <SelectParameters>
                    <asp:ControlParameter ControlID="pGv" Name="Original_ID" 
                        PropertyName="SelectedValue" Type="Int32" />
                </SelectParameters>
                <InsertParameters>
                    <asp:Parameter Name="NUMBER" Type="String" />
                    <asp:Parameter Name="NAME" Type="String" />
                    <asp:Parameter Name="GENDER" Type="String" />
                    <asp:Parameter Name="NATIONALITY" Type="String" />
                    <asp:Parameter Name="BIRTHDAY" Type="DateTime" />
                    <asp:Parameter Name="IDNUMBER" Type="String" />
                    <asp:Parameter Name="TELEPNONE" Type="String" />
                    <asp:Parameter Name="EMAIL" Type="String" />
                    <asp:Parameter Name="PRIORITY_ID" Type="Int32" />
                </InsertParameters>
            </asp:ObjectDataSource>
            <asp:DetailsView ID="partyDv" runat="server" AutoGenerateRows="False" 
                DataKeyNames="ID" DataSourceID="partyDvOds" Height="50px" Visible="False" 
                Width="500px" onitemupdated="partyDv_ItemUpdated">
                <FieldHeaderStyle Width="120px" />
                <Fields>
                    <asp:TemplateField HeaderText="申请时间" SortExpression="APP_TIME">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" onfocus="calendar()" Text='<%# Bind("APP_TIME") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" onfocus="calendar()" 
                                Text='<%# Bind("APP_TIME", "{0:d}") %>'></asp:TextBox>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("APP_TIME", "{0:d}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="成为积极分子时间" SortExpression="ACTIVE_TIME">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" onfocus="calendar()" Text='<%# Bind("ACTIVE_TIME") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" onfocus="calendar()"  
                                Text='<%# Bind("ACTIVE_TIME", "{0:d}") %>'></asp:TextBox>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label4" runat="server" 
                                Text='<%# Bind("ACTIVE_TIME", "{0:d}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="党校培训时间" SortExpression="TRAIN_TIME">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox3" runat="server" onfocus="calendar()" Text='<%# Bind("TRAIN_TIME") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox3" runat="server" onfocus="calendar()" 
                                Text='<%# Bind("TRAIN_TIME", "{0:d}") %>'></asp:TextBox>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("TRAIN_TIME", "{0:d}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="成为预备党员时间" SortExpression="PRE_TIME">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox4" runat="server" onfocus="calendar()" Text='<%# Bind("PRE_TIME") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox4" runat="server" onfocus="calendar()" 
                                Text='<%# Bind("PRE_TIME", "{0:d}") %>'></asp:TextBox>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("PRE_TIME", "{0:d}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="CONN_NAME" 
                        HeaderText="党内联系人姓名" SortExpression="CONN_NAME" />
                    <asp:BoundField DataField="INTRO_NAME" HeaderText="介绍人姓名" 
                        SortExpression="INTRO_NAME" />
                    <asp:TemplateField HeaderText="正式入党时间" SortExpression="FULL_TIME">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox5" runat="server" onfocus="calendar()" Text='<%# Bind("FULL_TIME") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox5" runat="server" onfocus="calendar()" 
                                Text='<%# Bind("FULL_TIME", "{0:d}") %>'></asp:TextBox>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label7" runat="server" Text='<%# Bind("FULL_TIME", "{0:d}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="支部名称" SortExpression="BRANCH_ID">
                        <EditItemTemplate>
                            <asp:DropDownList ID="branchDdl" runat="server" DataSourceID="branchOds" 
                                DataTextField="FULLNAME" DataValueField="ID" Height="20px" 
                                SelectedValue='<%# Bind("BRANCH_ID") %>' Width="150px">
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:DropDownList ID="branchDdl" runat="server" DataSourceID="branchOds" 
                                DataTextField="FULLNAME" DataValueField="ID" Height="20px" 
                                SelectedValue='<%# Bind("BRANCH_ID") %>' Width="150px">
                            </asp:DropDownList>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("FULLNAME") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="状态" SortExpression="STATE_ID">
                        <EditItemTemplate>
                            <asp:DropDownList ID="stateDdl" runat="server" DataSourceID="stateOds" 
                                DataTextField="STATE_TEXT" DataValueField="STATE_ID" Height="20px" 
                                SelectedValue='<%# Bind("STATE_ID") %>' Width="100px">
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:DropDownList ID="stateDdl" runat="server" DataSourceID="stateOds" 
                                DataTextField="STATE_TEXT" DataValueField="STATE_ID" Height="20px" 
                                SelectedValue='<%# Bind("STATE_ID") %>' Width="100px">
                            </asp:DropDownList>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Eval("STATE_TEXT") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False">
                        <EditItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                                CommandName="Update" Text="更新"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                                CommandName="Cancel" Text="取消"></asp:LinkButton>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                CommandName="Edit" Text="编辑"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="pinfoBt" runat="server" onclick="pinfoBt_Click">人员信息</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Fields>
                <HeaderStyle Width="150px" />
            </asp:DetailsView>
            <asp:ObjectDataSource ID="partyDvOds" runat="server" 
                OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataByID" 
                TypeName="managementTableAdapters.T_PARTYTableAdapter" 
                UpdateMethod="UpdateQuery">
                <UpdateParameters>
                    <asp:Parameter Name="APP_TIME" Type="DateTime" />
                    <asp:Parameter Name="ACTIVE_TIME" Type="DateTime" />
                    <asp:Parameter Name="TRAIN_TIME" Type="DateTime" />
                    <asp:Parameter Name="PRE_TIME" Type="DateTime" />
                    <asp:Parameter Name="CONN_NAME" Type="String" />
                    <asp:Parameter Name="INTRO_NAME" Type="String" />
                    <asp:Parameter Name="FULL_TIME" Type="DateTime" />
                    <asp:Parameter Name="BRANCH_ID" Type="Int32" />
                    <asp:Parameter Name="STATE_ID" Type="Int32" />
                    <asp:ControlParameter ControlID="pGv" Name="Original_ID" 
                        PropertyName="SelectedValue" Type="Int32" />
                </UpdateParameters>
                <SelectParameters>
                    <asp:ControlParameter ControlID="pGv" Name="Original_ID" 
                        PropertyName="SelectedValue" Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="branchOds" runat="server" DeleteMethod="Delete" 
                InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
                SelectMethod="GetData" TypeName="managementTableAdapters.T_BRANCHTableAdapter" 
                UpdateMethod="Update">
                <DeleteParameters>
                    <asp:Parameter Name="Original_ID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="YEAR" Type="String" />
                    <asp:Parameter Name="BR_NAME" Type="String" />
                    <asp:Parameter Name="Original_ID" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="YEAR" Type="String" />
                    <asp:Parameter Name="BR_NAME" Type="String" />
                </InsertParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="stateOds" runat="server" DeleteMethod="Delete" 
                InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
                SelectMethod="GetData" TypeName="managementTableAdapters.T_STATETableAdapter" 
                UpdateMethod="Update">
                <DeleteParameters>
                    <asp:Parameter Name="Original_STATE_ID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="STATE_TEXT" Type="String" />
                    <asp:Parameter Name="Original_STATE_ID" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="STATE_TEXT" Type="String" />
                </InsertParameters>
            </asp:ObjectDataSource>
            <asp:Label ID="errLb" runat="server"></asp:Label>
            </ContentTemplate>
    </asp:UpdatePanel>
    
</asp:Content>
